﻿--Frame
local f = CreateFrame("Frame","ESN_Hexer_Frame",WorldFrame)
f:SetToplevel(true)
f:SetFrameStrata("FULLSCREEN_DIALOG")
f:SetAllPoints(WorldFrame)
f:EnableMouse(false)
f:SetAlpha(0)
f:SetPoint("CENTER",0,0)

--Texture 
local t = f:CreateTexture(nil,"BACKGROUND")
	t:SetTexture("Interface\\AddOns\\ESN_Hexer\\Texture\\flash.tga")
	t:SetBlendMode("ADD")
	t:SetVertexColor(0,1,0) --Color
	t:SetAllPoints(f)
	f.texture = t
	
--Register Events
f:RegisterEvent("CHAT_MSG_LOOT")

--Script
f:SetScript("OnEvent", function(frame, event, name)
	if (event == "CHAT_MSG_LOOT") then
		if (string.find (arg1, ESN_Hexer_String_YouCreate) and string.find(arg1, ESN_Hexer_String_SoulShard)) then
			UIFrameFlash(f, 0.2, 0.5, 1.5, nil, 1, 0)
			PlaySoundFile("Interface\\AddOns\\ESN_Hexer\\Sound\\Fear.mp3")
			DoEmote("grin")
		end
	end
end)